import request from '@/utils/request'

// 获取人员信息列表
export function listPersonPage(data) {
  return request({
    url: '/person/list',
    method: 'get',
    params: data
  })
}

// 新增人员
export function addPerson(data){
  return request({
    url: '/person',
    method: 'post',
    data: data
  })
}

// 修改人员
export function updatePerson(data){
  return request({
    url: '/person/' + data.id,
    method: 'put',
    data: data
  })
}

// 删除人员
export function deletePerson(id){
  return request({
    url: '/person/' + id,
    method: 'delete'
  })
}

export function importFile(file,orgId){
  return request({
    url: '/person/import/' + orgId,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data; charset=utf-8'
    },
    data: file
  })
}

export function importFileNew(file,orgId){
  return request({
    url: '/person/importNew/' + orgId,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data; charset=utf-8'
    },
    data: file
  })
}
